/*
 * @Author: yuandawei
 * @Date: 2020-11-16 10:41:16
 * @LastEditTime: 2020-11-19 10:45:19
 * @LastEditors: Please set LastEditors
 * @Description: 通用请求API
 * @FilePath: \vue-admin-beautiful-pro-template\src\api\common.js
 */
import request from '@/utils/request'

// 判断是否存在分销顾问
export function isExitCounselor(params) {
  return request({
    url: '/distributionConsul/judgingExistence.do',
    method: 'GET',
    params,
  })
}

// 冻结分销员
export function freezeDistributor(data) {
  return request({
    url: '/distributor/frozenStatus.do',
    method: 'POST',
    data,
  })
}

// 冻结招顾
export function freezeCounselor(params) {
  return request({
    url: '/distributionConsul/updateEmployeeInfo.do',
    method: 'GET',
    params,
  })
}

// 分销员重新选择上下级
export function resetUpDown(data) {
  return request({
    url: '/distributor/choiceLevel.do',
    method: 'POST',
    data,
  })
}

// 招顾关系绑定或者解绑
export function bindrelationship(params) {
  return request({
    url: '/distributionConsul/unbundlingBinding.do',
    method: 'GET',
    params,
  })
}

// 图片上传
export function imagesUpload(params) {
  return request({
    url: '/distributionConsul/uploadPictures.do',
    method: 'GET',
    params,
  })
}

// 操作记录
export function operationRecord(params) {
  return request({
    url: '/operationRecord/findPageList.do',
    method: 'GET',
    params,
  })
}

// 获取分销规则
export function getDistributeRule(params) {
  return request({
    url: '/distributionConfig/getCommissionRule.do',
    method: 'GET',
    params,
  })
}

// 修改分销规则
export function alterDistributeRule(data) {
  return request({
    url: '/distributionConfig/updateCommissionRule.do',
    method: 'POST',
    data,
  })
}

// 检查账户
export function checkUserInfo(data) {
  return request({
    url: '/distributor/checkLogin.do',
    method: 'POST',
    data,
  })
}

// 显示二维码
export function showCode(data) {
  return request({
    url: '/weChat/wxQrcode.do',
    method: 'GET',
    data,
  })
}
